//
//  EditViewController.m
//  TrueLove
//
//  Created by han on 15-1-29.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "EditViewController.h"

@interface EditViewController ()
@property (nonatomic, retain) UIScrollView *scrollView;
@end

@implementation EditViewController
- (void)dealloc
{
    [self.scrollView release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"婚礼信息";
    
    self.scrollView = [[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)] autorelease];
    self.scrollView.contentSize = CGSizeMake(0, 700);
  //  self.scrollView.backgroundColor = [UIColor colorWithRed:214 green:214 blue:214 alpha:1];
    self.scrollView.backgroundColor = [UIColor cyanColor];
    self.scrollView.scrollEnabled = YES;
    self.scrollView.pagingEnabled = YES;
    [self.view addSubview:self.scrollView];
    
    [self showView1];
    [self showView2];
    [self showView3];
    
}
//新郎 新娘 信息
- (void)showView1
{
    UIView *view1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, 120)] autorelease];
    view1.backgroundColor = [UIColor whiteColor];
    [self.scrollView addSubview:view1];
    
    UILabel *bridegroomLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 100, 30)];
    bridegroomLabel.text = @"新郎的名字:";
    [view1 addSubview:bridegroomLabel];
    [bridegroomLabel release];
    
    UITextField *bridegroomTextField = [[UITextField alloc] initWithFrame:CGRectMake(140, 20, 200, 30)];
    bridegroomTextField.borderStyle = UITextBorderStyleRoundedRect;
    bridegroomTextField.placeholder = @"新郎名字";
    [view1 addSubview:bridegroomTextField];
    [bridegroomTextField release];
    
    UILabel *brideLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 70, 100, 30)];
    brideLabel.text = @"新娘的名字:";
    [view1 addSubview:brideLabel];
    [brideLabel release];
    
    UITextField *brideTextField = [[UITextField alloc] initWithFrame:CGRectMake(140, 70, 200, 30)];
    brideTextField.borderStyle = UITextBorderStyleRoundedRect;
    brideTextField.placeholder = @"新娘名字";
    [view1 addSubview:brideTextField];
    [brideTextField release];
   
    
}
//婚礼信息
- (void)showView2
{
    UIView *view2 = [[[UIView alloc] initWithFrame:CGRectMake(0, 150, self.view.bounds.size.width, 150)] autorelease];
    view2.backgroundColor = [UIColor whiteColor];
    [self.scrollView addSubview:view2];
    
    
    UILabel *WeddingTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 100, 30)];
    WeddingTimeLabel.text = @"婚礼时间:";
    [view2 addSubview:WeddingTimeLabel];
    [WeddingTimeLabel release];
    
    UITextField *TimeTextField = [[UITextField alloc] initWithFrame:CGRectMake(140, 20, 200, 30)];
    TimeTextField.placeholder = @"婚礼时间";
    TimeTextField.borderStyle = UITextBorderStyleRoundedRect;
    [view2 addSubview:TimeTextField];
    [TimeTextField release];

    UILabel *WeddingAddressLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 70, 100, 30)];
    WeddingAddressLabel.text = @"婚礼地址:";
    [view2 addSubview:WeddingAddressLabel];
    [WeddingAddressLabel release];
    
    UITextField *addressTextField = [[UITextField alloc] initWithFrame:CGRectMake(140, 70, 200, 30)];
    addressTextField.placeholder = @"婚礼地址";
    addressTextField.borderStyle = UITextBorderStyleRoundedRect;
    [view2 addSubview:addressTextField];
    [addressTextField release];
    
    UIButton *MapButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [MapButton setTitle:@"在地图上标注" forState:UIControlStateNormal];
    [MapButton addTarget:self action:@selector(getMapButton:) forControlEvents:UIControlEventTouchUpInside];
    MapButton.frame = CGRectMake(self.view.bounds.size.width / 2 - 40, 110, 100, 30);
    [view2 addSubview:MapButton];
   
}
//致宾客
- (void)showView3
{
    UITextField *explainTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 310, self.view.bounds.size.width, 200)];
    explainTextField.textAlignment = NSTextAlignmentLeft;
    explainTextField.backgroundColor = [UIColor whiteColor];
    [self.scrollView addSubview:explainTextField];
    [explainTextField release];
 
    
    UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(3, 3, 100, 30)];
    textLabel.text = @"致宾客:";
    [explainTextField addSubview:textLabel];
    
    [textLabel release];
}
- (void)getMapButton:(UIButton *)MapButton
{
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
